import online.chazi.bootplus.biz.utils.IReplyCode;
import online.chazi.bootplus.biz.utils.RR;

/**
 * 说明：作者很懒，什么都没留下
 * Created by 叉子同学 on 2020-04-20 15:54
 */
public enum MyReplyCode implements IReplyCode<MyReplyCode> {
    OK(0, "成功"),
    ERR(-100, "失败"),
    WRONG(500, "错误");
    int result;
    String msg;

    //直接注册到 RR
    static {
        RR.register(OK);
    }

    MyReplyCode(int result, String msg) {
        this.result = result;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return result;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    @Override
    public MyReplyCode SUCCESS() {
        return OK;
    }

    @Override
    public MyReplyCode ERROR() {
        return ERR;
    }
}